<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
   <title>佐心，教家长做父母</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
<c:set var="ctx" value="${pageContext.request.contextPath}" />
    <link rel="stylesheet" href="assets/css/amazeui.min.css">
    <link rel="stylesheet" href="assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="assets/css/index.css?v=2.3">
    <script>
    var allOrder=0;
    var weiOrder=0;
    var daiOrder=0;
    var yiOrder=0;
    var myOrderJson1=1;
    var myOrderJson2=1;
    var myOrderJson3=1;
    var myOrderJson4=1;
    var pram='${param.param}';
    if(pram=="deleteOrder"){
    	alert("订单取消成功!");
    	location.href="myOrder.jsp";
    }
    </script>
    <script>
    	    /** 
     * 返回前一页（或关闭本页面） 
     * <li>如果没有前一页历史，则直接关闭当前页面</li> 
     */  
    function goBack(){  
        location.href="${ctx}/myzones.jsp";
    }  
    </script>
</head>
<body class="bg-gray">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed am-border-bottom">
    <div class="am-header-left am-header-nav">
        <a  onclick="goBack();"  >
            <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        我的订单
    </h1>

</header>
<section class="am-padding-bottom-sm" id="amz-main" data-tag="css-nav">

    <!--切换tab-->
    <div data-am-widget="tabs"
         class="am-tabs am-tabs-d2 font-14 bg-white am-margin-top-sm pinglun-tabs am-border-bottom">
        <ul class="am-tabs-nav am-cf">
            <li class="am-active bg-white  " id="allOrder">
                <div class="width-100 border-right margin-top-6 height-30" ><a>全部</a></div>
            </li>
            <li class="bg-white" id="weiwangcheng">
                <div class="width-100 border-right margin-top-6 height-30"><a>未完成</a></div>
            </li>
            <li class="bg-white" id="daipingjia">
                <div class="width-100 border-right margin-top-6 height-30"><a>待评价</a></div>
            </li>
            <li class="bg-white" id="yiwangcheng">
                <div class="width-100  margin-top-6 height-30"><a>已完成</a></div>
            </li>
        </ul>

    </div>

    <!--列表-->
    <div class="margin-top-55 order_list">
        
    </div>


</section>
<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">订单取消</div>
        <div class="am-modal-bd">
            您，确定要取消这个订单吗？
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn" data-am-modal-confirm>确定</span>
        </div>
    </div>
</div>

<script src="assets/js/jquery.min.js"></script>

<script src="assets/js/amazeui.min.js"></script>
<script>
function goCounselor(tel){
        location.href="gotoCounselorDescjsp?tel="+tel;
};
	$(function(){
		var myOrderJson="";
		if(allOrder!=1){
			var myOrderData=$.ajax({url:"getMyOrder",async:false});
	        myOrderJson=JSON.parse(myOrderData.responseText);
	        allOrder=1;
	        myOrderJson1=myOrderJson;
        }else{
        	myOrderJson=myOrderJson1;
        }
        
        if(myOrderJson.resultCode=="0"){
	        for(var i=0;i<myOrderJson.orderList.length;i++){
	        	var html="";
	        	//<!--待完成-->
		        html+="<div class='order_item bg-white border-bottom am-margin-bottom-sm'>";
		            //<!--状态-->
		        if(myOrderJson.orderList[i].orderStatus==5){
		        html+="    <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		        html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		       	html+="            <span class='font-color-12'>待支付</span>";
		        html+="        </div>";
		        html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs '>";
		        html+="            <span data-id='"+myOrderJson.orderList[i].orderSn+"' class='am-btn am-btn-default am-btn-xs qt-btn btn_cancel_order' onclick='window.location.href=\"deleteOrder?orderId="+myOrderJson.orderList[i].id+"\"'>取消</span>";
		        html+="            <span class='am-btn am-btn-warning am-btn-xs qt-huan' onclick='window.location.href=\"addOrder?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>付款</span>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        
		        if(myOrderJson.orderList[i].orderStatus==2 && myOrderJson.orderList[i].orderStatus==4){
		        	 //<!--状态-->
		            html+="     <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		             html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		             if(myOrderJson.orderList[i].orderStatus==4){
		             	html+="            <span class='font-color-12'>订单被拒绝</span>";
		             }else{
		             	html+="            <span class='font-color-12'>咨询完成</span>";
		             }
		             html+="        </div>";
		             html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs ' onclick='window.location.href=\"myOrderPingjia.jsp?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>";
		              html+="           <span class='am-btn am-btn-warning am-btn-xs qt-huan'>评价</span>";
		              html+="       </div>";
		            html+="     </div>";
		        }
		        if("1"==myOrderJson.orderList[i].orderType){
		        
		        var peixunData=$.ajax({url:"myData?counseTel="+myOrderJson.orderList[i].counseTel,async:false});
       			var zixunJson=JSON.parse(peixunData.responseText);
		        
		        //    <!--咨询师-->
		        html+="    <div class='am-g  am-padding-top-sm '>";
		        html+="        <div class=' am-u-sm-12 am-list-main box am-padding-left-sm'>";
		        html+="            <div class='width-75px'>";
		        html+="                <a onclick='goCounselor("+zixunJson.counselor.counseTel+")' class=''>";
		        html+="                    <img class='img-65' src='"+zixunJson.counselor.personHead+"'/>";
		        html+="                </a>";
		        html+="            </div>";
		        html+="            <div class='box-1'>";
		        html+="                <div class='am-list-item-hd font-color-13'>";
		        html+=myOrderJson.orderList[i].counseName;
		        html+="                </div>";
		        html+="                <div class='font-12  font-color-15'>";
		        html+=zixunJson.counselor.professional;
		        html+="                </div>";
		        html+="                <div class='font-14  font-color-15'>";
		        html+=zixunJson.counselor.goodDirection;
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        //    <!--咨询介绍-->
		        html+="    <div class=' am-padding-bottom-sm' onclick='window.location.href='7.html''>";
		        html+="        <div class='report_item bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm '>";
		        html+="            <div class='am-g   am-padding-top-sm   am-padding-bottom-sm'>";
		        html+="                <div class=' am-u-sm-12 am-list-main font-color-13 box'>";
		        html+="                    <i class='icon_12'></i>";
		        html+="                    <div class='width-50px'>";
		        html+="                        <div class='icon_9-1'></div>";
		        html+="                        <div class='line-1'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                    <div class='box-1'>";
		        html+="                        <div class='am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate'>";
		        
		        var peixunJson="";
		        if("1"!=myOrderJson.orderList[i].orderType){
		        	var peixunData=$.ajax({url:"getPeinxunDesc?studyId="+myOrderJson.orderList[i].studyId,async:false});
       				peixunJson=JSON.parse(peixunData.responseText);
		        	html+="              培训/集训标题： "+peixunJson.study.studyTitle;
		        }else{
		        	if(1==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：电话咨询";
		        	}else if(2==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：面对面咨询";
		        	}else if(3==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：视频咨询";
		        	}
		        	
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14  margin-top-9 '>";
		         if("1"!=myOrderJson.orderList[i].orderType){
		         	html+="            培训/集训时间："+peixunJson.study.startStudyStr+" - "+peixunJson.study.endStudyStr;
		         }else{
		         	html+="             预约时间："+myOrderJson.orderList[i].bookTimeStr;
		         }
		        
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        if("1"==myOrderJson.orderList[i].orderType){
		        html+="              购买时长：<span class='font-color-17'>"+myOrderJson.orderList[i].serviceTime+"分钟</span>";
		        }else{
		        	  html+="              购买者：<span class='font-color-17'>"+myOrderJson.orderList[i].customerName+"</span>";
		        	  html+="              <br/>联系方式：<span class='font-color-17 '>"+myOrderJson.orderList[i].telephone+"</span>";
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        html+="              总价：<span class='font-color-17'>&yen;"+myOrderJson.orderList[i].orderPrice+"</span>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        html+="</div>";
		        $(".order_list").append(html);
	        }	
        }
	});


    $('.order_list').find('.btn_cancel_order').on('click', function () {
        $('#my-confirm').modal({
            relatedTarget: this,
            onConfirm: function (options) {
                var $delete = $(this.relatedTarget);
                var msg = $delete.length ? '你要取消咨询的ID为 ' + $delete.data('id') :
                        '';
                alert(msg);
            },
            onCancel: function () {
            }
        });
    });
    
    $("#weiwangcheng").on('click',function(){
    $(".order_list").html("");
    
    	var myOrderJson="";
		if(weiOrder!=1){
    		var myOrderData=$.ajax({url:"getMyOrder?orderStatus=weiwangcheng",async:false});
	        myOrderJson=JSON.parse(myOrderData.responseText);
	        weiOrder=1;
	        myOrderJson2=myOrderJson;
        }else{
        	myOrderJson=myOrderJson2;
        }
        if(myOrderJson.resultCode=="0"){
	        for(var i=0;i<myOrderJson.orderList.length;i++){
	        	 var html="";
	        	//<!--待完成-->
		        html+="<div class='order_item bg-white border-bottom am-margin-bottom-sm'>";
		            //<!--状态-->
		        if(myOrderJson.orderList[i].orderStatus==5){
		        html+="    <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		        html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		       	html+="            <span class='font-color-12'>待支付</span>";
		        html+="        </div>";
		        html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs '>";
		        html+="            <span data-id='1' class='am-btn am-btn-default am-btn-xs qt-btn btn_cancel_order' onclick='window.location.href=\"deleteOrder?orderId="+myOrderJson.orderList[i].id+"\"'>取消</span>";
		        html+="            <span class='am-btn am-btn-warning am-btn-xs qt-huan' onclick='window.location.href=\"addOrder?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>付款</span>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        
		        if(myOrderJson.orderList[i].orderStatus!=3 && myOrderJson.orderList[i].orderStatus!=5){
		        	 //<!--状态-->
		            html+="     <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		             html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		            if(myOrderJson.orderList[i].orderStatus==4){
		             	html+="            <span class='font-color-12'>订单被拒绝</span>";
		             }else{
		             	html+="            <span class='font-color-12'>咨询完成</span>";
		             }
		             html+="        </div>";
		             html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs ' onclick='window.location.href=\"myOrderPingjia.jsp?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>";
		              html+="           <span class='am-btn am-btn-warning am-btn-xs qt-huan'>评价</span>";
		              html+="       </div>";
		            html+="     </div>";
		        }
		        if("1"==myOrderJson.orderList[i].orderType){
		         var peixunData=$.ajax({url:"myData?counseTel="+myOrderJson.orderList[i].counseTel,async:false});
       			var zixunJson=JSON.parse(peixunData.responseText);
		        
		        //    <!--咨询师-->
		        html+="    <div class='am-g  am-padding-top-sm '>";
		        html+="        <div class=' am-u-sm-12 am-list-main box am-padding-left-sm'>";
		        html+="            <div class='width-75px'>";
		        html+="                <a onclick='goCounselor("+zixunJson.counselor.counseTel+")' class=''>";
		        html+="                    <img class='img-65' src='"+zixunJson.counselor.personHead+"'/>";
		        html+="                </a>";
		        html+="            </div>";
		        html+="            <div class='box-1'>";
		        html+="                <div class='am-list-item-hd font-color-13'>";
		        html+=myOrderJson.orderList[i].counseName;
		        html+="                </div>";
		        html+="                <div class='font-12  font-color-15'>";
		        html+=zixunJson.counselor.professional;
		        html+="                </div>";
		        html+="                <div class='font-14  font-color-15'>";
		        html+=zixunJson.counselor.goodDirection;
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        //    <!--咨询介绍-->
		        html+="    <div class=' am-padding-bottom-sm' onclick='window.location.href='7.html''>";
		        html+="        <div class='report_item bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm '>";
		        html+="            <div class='am-g   am-padding-top-sm   am-padding-bottom-sm'>";
		        html+="                <div class=' am-u-sm-12 am-list-main font-color-13 box'>";
		        html+="                    <i class='icon_12'></i>";
		        html+="                    <div class='width-50px'>";
		        html+="                        <div class='icon_9-1'></div>";
		        html+="                        <div class='line-1'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                    <div class='box-1'>";
		        html+="                        <div class='am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate'>";
		        
		        var peixunJson="";
		        if("1"!=myOrderJson.orderList[i].orderType){
		        	var peixunData=$.ajax({url:"getPeinxunDesc?studyId="+myOrderJson.orderList[i].studyId,async:false});
       				peixunJson=JSON.parse(peixunData.responseText);
		        	html+="              培训/集训标题： "+peixunJson.study.studyTitle;
		        }else{
		        	if(1==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：电话咨询";
		        	}else if(2==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：面对面咨询";
		        	}else if(3==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：视频咨询";
		        	}
		        	
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14  margin-top-9 '>";
		         if("1"!=myOrderJson.orderList[i].orderType){
		         	html+="            培训/集训时间："+peixunJson.study.startStudyStr+" - "+peixunJson.study.endStudyStr;
		         }else{
		         	html+="             预约时间："+myOrderJson.orderList[i].bookTimeStr;
		         }
		        
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        if("1"==myOrderJson.orderList[i].orderType){
		        html+="              购买时长：<span class='font-color-17'>"+myOrderJson.orderList[i].serviceTime+"分钟</span>";
		        }else{
		        	  html+="              购买者：<span class='font-color-17'>"+myOrderJson.orderList[i].customerName+"</span>";
		        	  html+="              <br/>联系方式：<span class='font-color-17 '>"+myOrderJson.orderList[i].telephone+"</span>";
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        html+="              总价：<span class='font-color-17'>&yen;"+myOrderJson.orderList[i].orderPrice+"</span>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        html+="</div>";
		        $(".order_list").append(html);
	        }	
        }
    });
    
    $("#allOrder").on('click',function(){
    $(".order_list").html("");
    
    
    	var myOrderJson="";
		if(allOrder!=1){
    		var myOrderData=$.ajax({url:"getMyOrder",async:false});
	        myOrderJson=JSON.parse(myOrderData.responseText);
	        allOrder=1;
	        myOrderJson1=myOrderJson;
        }else{
        	myOrderJson=myOrderJson1;
        }
        if(myOrderJson.resultCode=="0"){
	        for(var i=0;i<myOrderJson.orderList.length;i++){
	        	 var html="";
	        	//<!--待完成-->
		        html+="<div class='order_item bg-white border-bottom am-margin-bottom-sm'>";
		            //<!--状态-->
		        if(myOrderJson.orderList[i].orderStatus==5){
		        html+="    <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		        html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		       	html+="            <span class='font-color-12'>待支付</span>";
		        html+="        </div>";
		        html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs '>";
		        html+="            <span data-id='1' class='am-btn am-btn-default am-btn-xs qt-btn btn_cancel_order' onclick='window.location.href=\"deleteOrder?orderId="+myOrderJson.orderList[i].id+"\"'>取消</span>";
		        html+="            <span class='am-btn am-btn-warning am-btn-xs qt-huan'onclick='window.location.href=\"addOrder?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>付款</span>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        
		        if(myOrderJson.orderList[i].orderStatus!=3 && myOrderJson.orderList[i].orderStatus!=5){
		        	 //<!--状态-->
		            html+="     <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		             html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		             if(myOrderJson.orderList[i].orderStatus==4){
		             	html+="            <span class='font-color-12'>订单被拒绝</span>";
		             }else{
		             	html+="            <span class='font-color-12'>咨询完成</span>";
		             }
		             html+="        </div>";
		             html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs ' onclick='window.location.href=\"myOrderPingjia.jsp?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>";
		              html+="           <span class='am-btn am-btn-warning am-btn-xs qt-huan'>评价</span>";
		              html+="       </div>";
		            html+="     </div>";
		        }
		        if("1"==myOrderJson.orderList[i].orderType){
		        var peixunData=$.ajax({url:"myData?counseTel="+myOrderJson.orderList[i].counseTel,async:false});
       			var zixunJson=JSON.parse(peixunData.responseText);
		        
		        //    <!--咨询师-->
		        html+="    <div class='am-g  am-padding-top-sm '>";
		        html+="        <div class=' am-u-sm-12 am-list-main box am-padding-left-sm'>";
		        html+="            <div class='width-75px'>";
		        html+="                <a onclick='goCounselor("+zixunJson.counselor.counseTel+")' class=''>";
		        html+="                    <img class='img-65' src='"+zixunJson.counselor.personHead+"'/>";
		        html+="                </a>";
		        html+="            </div>";
		        html+="            <div class='box-1'>";
		        html+="                <div class='am-list-item-hd font-color-13'>";
		        html+=myOrderJson.orderList[i].counseName;
		        html+="                </div>";
		        html+="                <div class='font-12  font-color-15'>";
		        html+=zixunJson.counselor.professional;
		        html+="                </div>";
		        html+="                <div class='font-14  font-color-15'>";
		        html+=zixunJson.counselor.goodDirection;
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        //    <!--咨询介绍-->
		        html+="    <div class=' am-padding-bottom-sm' onclick='window.location.href='7.html''>";
		        html+="        <div class='report_item bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm '>";
		        html+="            <div class='am-g   am-padding-top-sm   am-padding-bottom-sm'>";
		        html+="                <div class=' am-u-sm-12 am-list-main font-color-13 box'>";
		        html+="                    <i class='icon_12'></i>";
		        html+="                    <div class='width-50px'>";
		        html+="                        <div class='icon_9-1'></div>";
		        html+="                        <div class='line-1'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                    <div class='box-1'>";
		        html+="                        <div class='am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate'>";
		        
		        var peixunJson="";
		        if("1"!=myOrderJson.orderList[i].orderType){
		        	var peixunData=$.ajax({url:"getPeinxunDesc?studyId="+myOrderJson.orderList[i].studyId,async:false});
       				peixunJson=JSON.parse(peixunData.responseText);
		        	html+="              培训/集训标题： "+peixunJson.study.studyTitle;
		        }else{
		        	if(1==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：电话咨询";
		        	}else if(2==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：面对面咨询";
		        	}else if(3==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：视频咨询";
		        	}
		        	
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14  margin-top-9 '>";
		         if("1"!=myOrderJson.orderList[i].orderType){
		         	html+="            培训/集训时间："+peixunJson.study.startStudyStr+" - "+peixunJson.study.endStudyStr;
		         }else{
		         	html+="             预约时间："+myOrderJson.orderList[i].bookTimeStr;
		         }
		        
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        if("1"==myOrderJson.orderList[i].orderType){
		        html+="              购买时长：<span class='font-color-17'>"+myOrderJson.orderList[i].serviceTime+"分钟</span>";
		        }else{
		        	  html+="              购买者：<span class='font-color-17'>"+myOrderJson.orderList[i].customerName+"</span>";
		        	  html+="              <br/>联系方式：<span class='font-color-17 '>"+myOrderJson.orderList[i].telephone+"</span>";
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        html+="              总价：<span class='font-color-17'>&yen;"+myOrderJson.orderList[i].orderPrice+"</span>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        html+="</div>";
		        $(".order_list").append(html);
	        }	
        }
    });
    $("#daipingjia").on('click',function(){
    $(".order_list").html("");
    
    	var myOrderJson="";
		if(daiOrder!=1){
    		var myOrderData=$.ajax({url:"getMyOrder?orderStatus=daipingjia",async:false});
	        myOrderJson=JSON.parse(myOrderData.responseText);
	        daiOrder=1;
	        myOrderJson3=myOrderJson;
        }else{
        	myOrderJson=myOrderJson3;
        }
        if(myOrderJson.resultCode=="0"){
	        for(var i=0;i<myOrderJson.orderList.length;i++){
	        	 var html="";
	        	//<!--待完成-->
		        html+="<div class='order_item bg-white border-bottom am-margin-bottom-sm'>";
		            //<!--状态-->
		        if(myOrderJson.orderList[i].orderStatus==5){
		        html+="    <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		        html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		       	html+="            <span class='font-color-12'>待支付</span>";
		        html+="        </div>";
		        html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs '>";
		        html+="            <span data-id='1' class='am-btn am-btn-default am-btn-xs qt-btn btn_cancel_order' onclick='window.location.href=\"deleteOrder?orderId="+myOrderJson.orderList[i].id+"\"'>取消</span>";
		        html+="            <span class='am-btn am-btn-warning am-btn-xs qt-huan'onclick='window.location.href=\"addOrder?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>付款</span>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        
		        if(myOrderJson.orderList[i].orderStatus!=3 && myOrderJson.orderList[i].orderStatus!=5){
		        	 //<!--状态-->
		            html+="     <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		             html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		             if(myOrderJson.orderList[i].orderStatus==4){
		             	html+="            <span class='font-color-12'>订单被拒绝</span>";
		             }else{
		             	html+="            <span class='font-color-12'>咨询完成</span>";
		             }
		             html+="        </div>";
		             html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs ' onclick='window.location.href=\"myOrderPingjia.jsp?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>";
		              html+="           <span class='am-btn am-btn-warning am-btn-xs qt-huan'>评价</span>";
		              html+="       </div>";
		            html+="     </div>";
		        }
		        if("1"==myOrderJson.orderList[i].orderType){
		         var peixunData=$.ajax({url:"myData?counseTel="+myOrderJson.orderList[i].counseTel,async:false});
       			var zixunJson=JSON.parse(peixunData.responseText);
		        
		        //    <!--咨询师-->
		        html+="    <div class='am-g  am-padding-top-sm '>";
		        html+="        <div class=' am-u-sm-12 am-list-main box am-padding-left-sm'>";
		        html+="            <div class='width-75px'>";
		        html+="                <a onclick='goCounselor("+zixunJson.counselor.counseTel+")' class=''>";
		        html+="                    <img class='img-65' src='"+zixunJson.counselor.personHead+"'/>";
		        html+="                </a>";
		        html+="            </div>";
		        html+="            <div class='box-1'>";
		        html+="                <div class='am-list-item-hd font-color-13'>";
		        html+=myOrderJson.orderList[i].counseName;
		        html+="                </div>";
		        html+="                <div class='font-12  font-color-15'>";
		        html+=zixunJson.counselor.professional;
		        html+="                </div>";
		        html+="                <div class='font-14  font-color-15'>";
		        html+=zixunJson.counselor.goodDirection;
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        //    <!--咨询介绍-->
		        html+="    <div class=' am-padding-bottom-sm' onclick='window.location.href='7.html''>";
		        html+="        <div class='report_item bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm '>";
		        html+="            <div class='am-g   am-padding-top-sm   am-padding-bottom-sm'>";
		        html+="                <div class=' am-u-sm-12 am-list-main font-color-13 box'>";
		        html+="                    <i class='icon_12'></i>";
		        html+="                    <div class='width-50px'>";
		        html+="                        <div class='icon_9-1'></div>";
		        html+="                        <div class='line-1'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                    <div class='box-1'>";
		        html+="                        <div class='am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate'>";
		        
		        var peixunJson="";
		        if("1"!=myOrderJson.orderList[i].orderType){
		        	var peixunData=$.ajax({url:"getPeinxunDesc?studyId="+myOrderJson.orderList[i].studyId,async:false});
       				peixunJson=JSON.parse(peixunData.responseText);
		        	html+="              培训/集训标题： "+peixunJson.study.studyTitle;
		        }else{
		        	if(1==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：电话咨询";
		        	}else if(2==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：面对面咨询";
		        	}else if(3==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：视频咨询";
		        	}
		        	
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14  margin-top-9 '>";
		         if("1"!=myOrderJson.orderList[i].orderType){
		         	html+="            培训/集训时间："+peixunJson.study.startStudyStr+" - "+peixunJson.study.endStudyStr;
		         }else{
		         	html+="             预约时间："+myOrderJson.orderList[i].bookTimeStr;
		         }
		        
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        if("1"==myOrderJson.orderList[i].orderType){
		        html+="              购买时长：<span class='font-color-17'>"+myOrderJson.orderList[i].serviceTime+"分钟</span>";
		        }else{
		        	  html+="              购买者：<span class='font-color-17'>"+myOrderJson.orderList[i].customerName+"</span>";
		        	  html+="              <br/>联系方式：<span class='font-color-17 '>"+myOrderJson.orderList[i].telephone+"</span>";
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        html+="              总价：<span class='font-color-17'>&yen;"+myOrderJson.orderList[i].orderPrice+"</span>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        html+="</div>";
		        $(".order_list").append(html);
	        }	
        }
    });
    $("#yiwangcheng").on('click',function(){
    $(".order_list").html("");
    
    	var myOrderJson="";
		if(yiOrder!=1){
    		var myOrderData=$.ajax({url:"getMyOrder?orderStatus=yiwangcheng",async:false});
	        myOrderJson=JSON.parse(myOrderData.responseText);
	        yiOrder=1;
	        myOrderJson4=myOrderJson;
        }else{
        	myOrderJson=myOrderJson4;
        }
        if(myOrderJson.resultCode=="0"){
	        for(var i=0;i<myOrderJson.orderList.length;i++){
	        	 var html="";
	        	//<!--待完成-->
		        html+="<div class='order_item bg-white border-bottom am-margin-bottom-sm'>";
		            //<!--状态-->
		        if(myOrderJson.orderList[i].orderStatus==5){
		        html+="    <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		        html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		       	html+="            <span class='font-color-12'>待支付</span>";
		        html+="        </div>";
		        html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs '>";
		        html+="            <span data-id='1' class='am-btn am-btn-default am-btn-xs qt-btn btn_cancel_order' onclick='window.location.href=\"deleteOrder?orderId="+myOrderJson.orderList[i].id+"\"'>取消</span>";
		        html+="            <span class='am-btn am-btn-warning am-btn-xs qt-huan'onclick='window.location.href=\"addOrder?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>付款</span>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        
		        if(myOrderJson.orderList[i].orderStatus!=3 && myOrderJson.orderList[i].orderStatus!=5){
		        	 //<!--状态-->
		            html+="     <div class='am-g    am-text-sm am-margin-top-xs border-top-bottom'>";
		             html+="        <div class='am-u-sm-6   margin-status am-padding-bottom-xs '>";
		             if(myOrderJson.orderList[i].orderStatus==4){
		             	html+="            <span class='font-color-12'>订单被拒绝</span>";
		             }else{
		             	html+="            <span class='font-color-12'>咨询完成</span>";
		             }
		             html+="        </div>";
		             html+="        <div class='am-u-sm-6  am-padding-top-xs am-padding-bottom-xs ' onclick='window.location.href=\"myOrderPingjia.jsp?orderSn="+myOrderJson.orderList[i].orderSn+"\"'>";
		              html+="           <span class='am-btn am-btn-warning am-btn-xs qt-huan'>评价</span>";
		              html+="       </div>";
		            html+="     </div>";
		        }
		        if("1"==myOrderJson.orderList[i].orderType){
		         var peixunData=$.ajax({url:"myData?counseTel="+myOrderJson.orderList[i].counseTel,async:false});
       			var zixunJson=JSON.parse(peixunData.responseText);
		        
		        //    <!--咨询师-->
		        html+="    <div class='am-g  am-padding-top-sm '>";
		        html+="        <div class=' am-u-sm-12 am-list-main box am-padding-left-sm'>";
		        html+="            <div class='width-75px'>";
		        html+="                <a onclick='goCounselor("+zixunJson.counselor.counseTel+")' class=''>";
		        html+="                    <img class='img-65' src='"+zixunJson.counselor.personHead+"'/>";
		        html+="                </a>";
		        html+="            </div>";
		        html+="            <div class='box-1'>";
		        html+="                <div class='am-list-item-hd font-color-13'>";
		        html+=myOrderJson.orderList[i].counseName;
		        html+="                </div>";
		        html+="                <div class='font-12  font-color-15'>";
		        html+=zixunJson.counselor.professional;
		        html+="                </div>";
		        html+="                <div class='font-14  font-color-15'>";
		        html+=zixunJson.counselor.goodDirection;
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        }
		        //    <!--咨询介绍-->
		        html+="    <div class=' am-padding-bottom-sm' onclick='window.location.href='7.html''>";
		        html+="        <div class='report_item bg-gray am-margin-left-sm am-margin-right-sm am-margin-top-sm '>";
		        html+="            <div class='am-g   am-padding-top-sm   am-padding-bottom-sm'>";
		        html+="                <div class=' am-u-sm-12 am-list-main font-color-13 box'>";
		        html+="                    <i class='icon_12'></i>";
		        html+="                    <div class='width-50px'>";
		        html+="                        <div class='icon_9-1'></div>";
		        html+="                        <div class='line-1'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                        <div class='line-2'>";
		        html+="                            <i class='circle-1'></i>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                    <div class='box-1'>";
		        html+="                        <div class='am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate'>";
		        
		        var peixunJson="";
		        if("1"!=myOrderJson.orderList[i].orderType){
		        	var peixunData=$.ajax({url:"getPeinxunDesc?studyId="+myOrderJson.orderList[i].studyId,async:false});
       				peixunJson=JSON.parse(peixunData.responseText);
		        	html+="              培训/集训标题： "+peixunJson.study.studyTitle;
		        }else{
		        	if(1==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：电话咨询";
		        	}else if(2==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：面对面咨询";
		        	}else if(3==myOrderJson.orderList[i].counseType){
		        		html+="              咨询方式：视频咨询";
		        	}
		        	
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14  margin-top-9 '>";
		         if("1"!=myOrderJson.orderList[i].orderType){
		         	html+="            培训/集训时间："+peixunJson.study.startStudyStr+" - "+peixunJson.study.endStudyStr;
		         }else{
		         	html+="             预约时间："+myOrderJson.orderList[i].bookTimeStr;
		         }
		        
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        if("1"==myOrderJson.orderList[i].orderType){
		        html+="              购买时长：<span class='font-color-17'>"+myOrderJson.orderList[i].serviceTime+"分钟</span>";
		        }else{
		        	  html+="              购买者：<span class='font-color-17'>"+myOrderJson.orderList[i].customerName+"</span>";
		        	  html+="              <br/>联系方式：<span class='font-color-17 '>"+myOrderJson.orderList[i].telephone+"</span>";
		        }
		        html+="                        </div>";
		        html+="                        <div class='font-14   margin-top-9'>";
		        html+="              总价：<span class='font-color-17'>&yen;"+myOrderJson.orderList[i].orderPrice+"</span>";
		        html+="                        </div>";
		        html+="                    </div>";
		        html+="                </div>";
		        html+="            </div>";
		        html+="        </div>";
		        html+="    </div>";
		        html+="</div>";
		        $(".order_list").append(html);
	        }	
        }
    });

</script>
</body>
</html>